/*
 *  Copyright 2004 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.webapp.form.core;

import com.blandware.atleap.webapp.form.BaseForm;
import org.apache.struts.action.ActionMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>Form bean for search and advanced search
 * </p>
 * <p><a href="SearchForm.java.html"><i>View Source</i></a></p>
 * <p/>
 *
 * @author Andrey Grebnev <a href="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
 * @version $Revision: 1.8 $ $Date: 2005/08/24 10:22:29 $
 * @struts.form name="searchForm"
 */
public class SearchForm extends BaseForm {

    /**
     * Search query
     */
	protected String query = null;
    /**
     * Search language
     */
	protected String searchLanguage = null;
    /**
     * Number of days that define how old may be found material
     */
	protected String timePeriod = "0";

    /**
     * Returns search query
     *
     * @return search query
     */
	public String getQuery() {
		return query;
	}

    /**
     * Sets search query
     *
     * @param query search query to set
     */
	public void setQuery(String query) {
		this.query = query;
	}

    /**
     * Returns search language
     *
     * @return search language
     */
	public String getSearchLanguage() {
		return searchLanguage;
	}

    /**
     * Sets search language
     *
     * @param searchLanguage search query to set
     */
	public void setSearchLanguage(String searchLanguage) {
		this.searchLanguage = searchLanguage;
	}

    /**
     * Returns time period. That's the number of days that define how old may
     * be found material
     *
     * @return time period
     */
	public String getTimePeriod() {
		return timePeriod;
	}

	/**
     * Sets time period. That's the number of days that define how old may
     * be found material
     *
     * @param timePeriod time period to set
	 * @struts.validator type="integer"
	 */
	public void setTimePeriod(String timePeriod) {
		this.timePeriod = timePeriod;
	}


	/**
	 * Resets all properties to their default values
	 *
	 * @param mapping The ActionMapping used to select this instance
	 * @param request The non-http request we are proceeding
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		this.query = null;
		this.searchLanguage = null;
		this.timePeriod = "0";
	}

}